package com.qingpeng.pay.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.flyco.tablayout.SlidingTabLayout;
import com.qingpeng.pay.R;
import com.qingpeng.pay.base.BaseActivity;
import com.qingpeng.pay.fragment.MessageFragment;
import com.qingpeng.pay.fragment.MineFragment;
import com.qingpeng.pay.fragment.NoticeListFragment;
import com.qingpeng.pay.fragment.OrderFragment;
import com.qingpeng.pay.views.TitleBar;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MessageActivity extends BaseActivity {

    @BindView(R.id.tablayout)
    SlidingTabLayout tablayout;
    @BindView(R.id.viewPager)
    ViewPager viewPager;
    @BindView(R.id.title)
    TitleBar title;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_message;
    }

    @Override
    protected int getRootViewId() {
        return 0;
    }

    @Override
    protected int getRefreshId() {
        return 0;
    }

    @Override
    protected int getListViewId() {
        return 0;
    }

    @Override
    protected void onResume() {
        super.onResume();
        title.getLlLeft().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        super.initView(savedInstanceState);
        String[] strings = {"通知", "公告"};
        ArrayList<Fragment> mFragments = new ArrayList<>();
        mFragments.add(new NoticeListFragment());
        mFragments.add(new MessageFragment());
        tablayout.setViewPager(viewPager, strings, this, mFragments);
    }

}
